﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace parallel_sema_csharp
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private string fileName;

        private Bitmap image;

        private void openImage_Click(object sender, EventArgs e)
        {
            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                fileName = openFileDialog.FileName;
                image = new Bitmap(fileName);
                pictureBox.Image = image;
            }
        }

        private void exit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void roughnessFilter_Click(object sender, EventArgs e)
        {
            RoughnessFilterDialog dialog = new RoughnessFilterDialog();
            dialog.LoadImage(image);
            dialog.Show();
        }
    }
}
